package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.net.mapper.ElementIsisLspMapper;
import com.ruoyi.net.domain.ElementIsisLsp;
import com.ruoyi.net.service.IElementIsisLspService;

/**
 * 网元-ISIS配置-lsp刷新配置Service业务层处理
 * 
 * @author net
 * @date 2024-11-17
 */
@Service
public class ElementIsisLspServiceImpl implements IElementIsisLspService 
{
    @Autowired
    private ElementIsisLspMapper elementIsisLspMapper;

    /**
     * 查询网元-ISIS配置-lsp刷新配置
     * 
     * @param id 网元-ISIS配置-lsp刷新配置主键
     * @return 网元-ISIS配置-lsp刷新配置
     */
    @Override
    public ElementIsisLsp selectElementIsisLspById(String id)
    {
        return elementIsisLspMapper.selectElementIsisLspById(id);
    }

    /**
     * 查询网元-ISIS配置-lsp刷新配置列表
     * 
     * @param elementIsisLsp 网元-ISIS配置-lsp刷新配置
     * @return 网元-ISIS配置-lsp刷新配置
     */
    @Override
    public List<ElementIsisLsp> selectElementIsisLspList(ElementIsisLsp elementIsisLsp)
    {
        return elementIsisLspMapper.selectElementIsisLspList(elementIsisLsp);
    }

    /**
     * 新增网元-ISIS配置-lsp刷新配置
     * 
     * @param elementIsisLsp 网元-ISIS配置-lsp刷新配置
     * @return 结果
     */
    @Override
    public int insertElementIsisLsp(ElementIsisLsp elementIsisLsp)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(elementIsisLsp.getId())) {
            elementIsisLsp.setId(uuid);
        }
        elementIsisLsp.setCreateBy(SecurityUtils.getUsername());
        elementIsisLsp.setCreateTime(DateUtils.getNowDate());
        elementIsisLsp.setUpdateBy(SecurityUtils.getUsername());
        elementIsisLsp.setUpdateTime(DateUtils.getNowDate());
        return elementIsisLspMapper.insertElementIsisLsp(elementIsisLsp);
    }

    /**
     * 修改网元-ISIS配置-lsp刷新配置
     * 
     * @param elementIsisLsp 网元-ISIS配置-lsp刷新配置
     * @return 结果
     */
    @Override
    public int updateElementIsisLsp(ElementIsisLsp elementIsisLsp)
    {
        elementIsisLsp.setUpdateBy(SecurityUtils.getUsername());
        elementIsisLsp.setUpdateTime(DateUtils.getNowDate());
        return elementIsisLspMapper.updateElementIsisLsp(elementIsisLsp);
    }

    /**
     * 批量删除网元-ISIS配置-lsp刷新配置
     * 
     * @param ids 需要删除的网元-ISIS配置-lsp刷新配置主键
     * @return 结果
     */
    @Override
    public int deleteElementIsisLspByIds(String[] ids)
    {
        return elementIsisLspMapper.deleteElementIsisLspByIds(ids);
    }

    /**
     * 删除网元-ISIS配置-lsp刷新配置信息
     * 
     * @param id 网元-ISIS配置-lsp刷新配置主键
     * @return 结果
     */
    @Override
    public int deleteElementIsisLspById(String id)
    {
        return elementIsisLspMapper.deleteElementIsisLspById(id);
    }
}
